using System.IO;

namespace WindowsAPI.PE
{
    public class Byte4ByteCoffReader : BaseCoffReader
    {
        public Byte4ByteCoffReader(string FileName) : base(FileName) { }

        protected override CoffHeader ParseInternal(BinaryReader br)
        {
            var coff = new CoffHeader();
            {
                coff.Machine = (IMAGE_FILE_MACHINE)br.ReadInt16();
                coff.NumberOfSection = (ushort)br.ReadInt16();
                coff.TimeDateStamp = br.ReadUInt32();
                coff.PointerToSymbolTable = br.ReadUInt32();
                coff.NumberOfSymbols = br.ReadUInt32();
                coff.SizeOfOptionalHeader = (ushort)br.ReadInt16();
                coff.Characteristics = (Characteristic)br.ReadInt16();
            }
            return coff;
        }
    }
}